﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html class="x-admin-sm">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta name="viewport" content="width=device-width" />
    <meta charset="UTF-8">
    <title>系统应用授权</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link href="~/Content/X-admin/css/font.css" rel="stylesheet" />
    <script src="~/Content/X-admin/lib/layui/layui.js"></script>
    <link href="~/Content/X-admin/css/xadmin.css" rel="stylesheet" />
    <script src="~/Content/X-admin/js/jquery.min.js"></script>
    <script src="~/Content/X-admin/js/xadmin.js"></script>
    <script src="~/Content/Scripts/System/systemFrame.js"></script>
</head>
<body>


    <div style="margin: 20px; border: 1px solid #dbdbdb;padding:15px">
        <p style="font-size:30px;font-weight:200;padding-left:50px;color:#1c6dc2">
            系统授权界面
        </p>
        <br />
        <form id="AddForm" class="layui-form layui-col-space5">

      
            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
                    校验编码
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="jyCode" name="jyCode" required="" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label for="L_email" class="layui-form-label">
                    授权码
                </label>
                <div class="layui-input-block">
                  
                    <textarea placeholder="授权码" id="keyCode" name="keyCode" class="layui-textarea" readonly></textarea>
                </div>

            </div>
            <div class="layui-form-item layui-form-text">
                <label for="L_email" class="layui-form-label">
                   授权信息
                </label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入参数内容" id="contents" name="contents" class="layui-textarea"></textarea>
                </div>
            </div>
         
  
        </form>
        <span style="margin-top:15px;margin-left:15px">
         
                <button class="layui-btn" onclick="saveData()"><i class="layui-icon">&#xe681;</i>注册</button>
                <button class="layui-btn" onclick="closeWin()"><i class="layui-icon">&#xe64d;</i>取消</button>
           
        </span>
    </div>
</body>
</html>
<script type="text/javascript">
    $(function () {
    
        loadData();
    });

    // 保存数据
    function saveData() {
        layui.use('layer', function () {
            layer = layui.layer;

            $.ajax({
                url: "../System/SaveKeyCode",
                data: { datas: JSON.stringify(FormToJson("AddForm")) },
                dataType: "json",
                type: "POST",
                success: function (rsl) {
                    if (rsl.Result) {
                        layer.msg("授权码生成成功");
                    } else {
                        layer.msg(rsl.Message);
                    }
                }
            });

        })
        
    }

    //加载数据信息
    function loadData() {
        $.ajax({
            url: "../System/GetSysKeyCode",
            type: "post",
            success: function (rsl) {
                if (rsl.Result) {
                    var d = rsl.Data;
                    $("#contents").html(d["info"]);
                    $("#keyCode").html(d["keyCode"]);
                 
                }
            }
        });

    }
</script>